package simple.logic;

import org.nutz.ioc.loader.annotation.IocBean;
import simple.common.BaseEntity;
import simple.common.BaseLogic;
import simple.entity.UserEntity;

@IocBean
public class UserLogic extends BaseLogic<UserEntity>{

    public UserEntity save(UserEntity user) {
        if (user.isNew()) {
            user.setId(BaseEntity.uuid());
            return insert(user);
        }
        return update(user);
    }
    
}
